<template>
	<view>
		<block v-for="(item,index) in diyItems" :key='index'>
			<!-- 搜索框 -->
			<block v-if="item.type == 'search'">
				<search :itemStyle="item.style" :params="item.params"></search>
			</block>
			<!-- 轮播图 -->
			<block v-if="item.type == 'banner'">
				<banner :itemStyle="item.style" :itemData="item.data" :params="item.params"></banner>
			</block>
			<!-- 单图组 -->
			<block v-if="item.type == 'imageSingle'">
				<imageSingle :itemStyle="item.style" :dataList="item.data"></imageSingle>
			</block>
			<!-- 图片橱窗 -->
			<block v-if="item.type == 'window'">
				<window :itemStyle="item.style" :dataList="item.data"></window>
			</block>
			<!-- 视频组 -->
			<block v-if="item.type == 'video'">
				<divvideo :itemStyle="item.style" :params="item.params"></divvideo>
			</block>
			<!-- 文章组 -->
			<block v-if="item.type == 'article'">
				<divarticle :params="item.params" :dataList="item.data"></divarticle>
			</block>
			<!-- 头条快报 -->
			<block v-if="item.type == 'special'">
				<special :itemStyle="item.style" :params="item.params" :dataList="item.data"></special>
			</block>
			<!-- 公告组 -->
			<block v-if="item.type == 'notice'">
				<notice :itemStyle="item.style" :params="item.params"></notice>
			</block>
			<!-- 导航组 -->
			<block v-if="item.type == 'navBar'">
				<navBar :itemStyle="item.style" :dataList="item.data"></navBar>
			</block>
			<!-- 商品组 -->
			<block v-if="item.type == 'goods'">
				<goods :itemStyle="item.style" :dataList="item.data"></goods>
			</block>
			<!-- 优惠券组 -->
			<block v-if="item.type == 'coupon'">
				<coupon :itemStyle="item.style" :dataList="item.data"></coupon>
			</block>
			<!-- 拼团商品 -->
			<block v-if="item.type == 'sharingGoods'">
				<sharingGoods :itemStyle="item.style" :dataList="item.data"></sharingGoods>
			</block>
			<!-- 砍价商品 -->
			<block v-if="item.type == 'bargainGoods'">
				<bargainGoods :itemStyle="item.style" :dataList="item.data"></bargainGoods>
			</block>
			<!-- 秒杀商品 -->
			<block v-if="item.type == 'sharpGoods'">
				<sharpGoods  :itemStyle="item.style" :dataList=" item.data "></sharpGoods>
			</block>
			<!-- 在线客服 -->
			<block v-if="item.type == 'service'">
				<service :itemStyle="item.style" :params="item.params"></service>
			</block>
			<!-- 富文本 -->
			<block v-if="item.type == 'richText'">
				<richText :itemStyle="item.style" :params="item.params"></richText>
			</block>
			<!-- 空白组 -->
			<block v-if="item.type == 'blank'">
				<diyblank :itemStyle="item.style"></diyblank>
			</block>
			<!-- 辅助线 -->
			<block v-if="item.type == 'guide'">
				<guide :itemStyle="item.style"></guide>
			</block>
			<!-- 线下门店 -->
			<block v-if="item.type == 'shop'">
				<shop :itemStyle=" item.style " :dataList=" item.data "></shop>
			</block>
			
			<!-- 信息卡片 -->
			<block v-if="item.type == 'informationcard'">
				<informationcard :itemStyle="item.style" :dataList="item.data"></informationcard>
			</block>
			
			<!-- 主副标题 -->
			<block v-if="item.type == 'thetitle'">
				<thetitle :itemStyle="item.style"></thetitle>
			</block>
			<!-- 文字按钮 -->
			<block v-if="item.type == 'textbutton'">
				<textbutton :itemStyle="item.style" :dataList="item.data"></textbutton>
			</block>
			
		</block>
	</view>
</template>

<script>
	import search from './search.vue'
	import banner from './banner.vue'
	import imageSingle from './imageSingle.vue'
	import window from './window.vue'
	import divvideo from './divvideo.vue'
	import divarticle from './divarticle.vue'
	import special from './special.vue'
	import notice from './notice.vue'
	import navBar from './navBar.vue'
	import goods from './goods.vue'
	import coupon from './coupon.vue'
	import sharingGoods from './sharingGoods.vue'
	import bargainGoods from './bargainGoods.vue'
	import sharpGoods from './sharpGoods.vue'
	import service from './service.vue'
	import richText from './richText.vue'
	import diyblank from './diyblank.vue'
	import guide from './guide.vue'
	import shop from './shop.vue'
	import wiper from './swiper.vue'
	import informationcard from './informationcard.vue'
	import thetitle from './thetitle.vue'
	import textbutton from './textbutton.vue'
	export default {
		components: {
			// （组件命名）
			search,
			banner,
			imageSingle,
			window,
			divvideo,
			divarticle,
			special,
			notice,
			navBar,
			goods,
			coupon,
			sharingGoods,
			bargainGoods,
			sharpGoods,
			service,
			richText,
			diyblank,
			guide,
			wiper,
			shop,
			textbutton,
			thetitle,
			informationcard
		},
		props: {
			diyItems: {},
			banner: {},
			imageSingle: {},
			window: {},
			divvideo: {},
			divarticle: {},
			special: {},
			notice: {},
			navBar: {},
			goods: {},
			coupon: {},
			sharingGoods: {},
			bargainGoods: {},
			sharpGoods: {},
			service: {},
			richText: {},
			diyblank: {},
			guide: {},
			shop: {}
		}
	}
</script>
